//
//  KeHuXiangQingCaoZuoTableViewCell.m
//  JuBoCRM
//
//  Created by iMac on 2024/2/18.
//  Copyright © 2024 iningKe. All rights reserved.
//

#import "KeHuXiangQingCaoZuoTableViewCell.h"

@implementation KeHuXiangQingCaoZuoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
 
}

- (void)setModel:(AllModel *)model{
    _model = model;
    
    NSDictionary *dataDic = model.modelInfoDictionary;
    
    _nameLabel.text = GetHandleString(dataDic, @"realname");
    
    _timeLabel.text = GetHandleString(dataDic, @"createTime");
    
    _contentLabel.text = GetHandleString(dataDic, @"detail");
    
    [_headImage sd_setImageWithURL:WebImagePath(GetHandleString(dataDic, @"urlImage")) placeholderImage:HeadImagePlaceholder];
    _buMenLabel.text = GetHandleString(dataDic, @"deptName");
    
    if(model.isSelect){
        _statusImage.sd_layout
        .leftSpaceToView(self.contentView, 15.5)
        .centerYEqualToView(_headImage)
        .heightIs(9)
        .widthIs(9);
    }else{
        _statusImage.sd_layout
        .leftSpaceToView(self.contentView, 15.5)
        .centerYEqualToView(_headImage)
        .heightIs(6)
        .widthIs(6);
    }
    
    if(_contentLabel.text.length > 0){
        _contentLabel.sd_layout
        .leftEqualToView(_headImage)
        .topSpaceToView(_statusView1, 16)
        .rightSpaceToView(self.contentView, 16)
        .autoHeightRatio(0);
    }else{
        _contentLabel.sd_layout
        .leftEqualToView(_headImage)
        .topSpaceToView(_statusView1, 0)
        .rightSpaceToView(self.contentView, 16)
        .autoHeightRatio(0);
    }
    
    
    _topLineImage.sd_layout
    .centerXEqualToView(_statusImage)
    .topSpaceToView(self.contentView, 0)
    .bottomSpaceToView(_statusImage, 0)
    .widthIs(0.5);
    
    _bottomLineImage.sd_layout
    .centerXEqualToView(_statusImage)
    .topSpaceToView(_statusImage, 0)
    .bottomSpaceToView(self.contentView, 0)
    .widthIs(0.5);
    
    [self setupAutoHeightWithBottomView:_contentLabel bottomMargin:8];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



@end



